import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
import Layout from '@/layout'

const routes = [
    {
        path: '/redirect',
        component: Layout,
        meta: {authority: [0], id: 20000},
        children: [
            {
                meta: {authority: [100], id: 20000},
                path: '/redirect/:path(.*)',
                component: () => import(/* webpackChunkName: "redirect-index" */ '@/views/redirect/index')
            }
        ]
    },
    {
        path: '/',
        redirect: '/login',
        meta: {authority: [0]},
    }, {
        path: '/login',
        name: 'login',
        meta: {authority: [0]},
        component: () => import(/* webpackChunkName: "login" */ '@/views/login')
    },
    {
        path: '/navigation0',
        name: 'navigation0',
        component: Layout,
        redirect: '/navigation0/index',
        meta: {title: '基础设置', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-setting'},
        children: [{
            path: 'index',
            name: 'navigation0',
            meta: {title: '基础设置', authority: [100]},
            component: () => import(/* webpackChunkName: "navigation0" */ '@/views/navigation0')
        }]
    },

    {
        path: '/navigation1',
        name: 'navigation1',
        component: Layout,
        redirect: '/navigation1/index',
        meta: {title: '茶室管理', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-edit'},
        children: [{
            path: 'index',
            name: 'navigation1',
            meta: {title: '茶室管理', authority: [100]},
            component: () => import(/* webpackChunkName: "navigation1" */ '@/views/navigation1')
        }]
    },

    {
        path: '/navigation2',
        name: 'navigation2',
        component: Layout,
        redirect: '/navigation2/index',
        meta: {title: '茶室当前使用情况', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-document'},
        children: [{
            path: 'index',
            name: 'navigation2',
            meta: {title: '茶室当前使用情况', authority: [100]},
            component: () => import(/* webpackChunkName: "navigation2" */ '@/views/navigation2')
        }]
    },

    {
        path: '/navigation3',
        name: 'navigation3',
        component: Layout,
        redirect: '/navigation3/index',
        meta: {title: '历史使用记录', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-document-copy'},
        children: [{
            path: 'index',
            name: 'navigation3',
            meta: {title: '历史使用记录', authority: [100]},
            component: () => import(/* webpackChunkName: "navigation3" */ '@/views/navigation3')
        }]
    },

    // {
    //     path: '/navigation4',
    //     name: 'navigation4',
    //     component: Layout,
    //     redirect: '/navigation4/index',
    //     meta: {title: '人员管理', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-user'},
    //     children: [{
    //         path: 'index',
    //         name: 'navigation4',
    //         meta: {title: '人员管理', authority: [100]},
    //         component: () => import(/* webpackChunkName: "navigation4" */ '@/views/navigation4')
    //     }]
    // },

    {
        path: '/systemSettings',
        name: 'systemSettings',
        component: Layout,
        redirect: '/systemSettings/roleSetUp',
        meta: {title: '系统设置', authority: [100], id: 20000, icon: 'el-icon-setting'},
        children: [{
            path: 'roleSetUp',
            name: 'roleSetUp',
            meta: {title: '角色设置', authority: [100], id: 20000},
            component: () => import(/* webpackChunkName: "/systemSettings/roleSetUp" */ '@/views/systemSettings/roleSetUp')
        }, {
            path: 'accountSettings',
            name: 'accountSettings',
            meta: {title: '管理员配置', authority: [100], id: 20000},
            component: () => import(/* webpackChunkName: "/systemSettings/accountSettings" */ '@/views/systemSettings/accountSettings')
        }, {
            path: 'systemLog',
            name: 'systemLog',
            meta: {title: '系统日志', authority: [100], id: 20000},
            component: () => import(/* webpackChunkName: "/systemSettings/systemLog" */ '@/views/systemSettings/systemLog')
        }]
    },
]
const router = new VueRouter({
    routes
})
export default router
